{
    function createButton(text, container, className) {
        var button = document.createElement("button");
        button.textContent = text;
        if (className) {
            button.className = className;
        }
        container.appendChild(button);
        return button;
    }
    var container_1 = document.createElement('div');
    container_1.classList.add('calculator');
    document.body.appendChild(container_1);
    var output = document.createElement('div');
    output.classList.add('output');
    var span = document.createElement('span');
    span.textContent = '0';
    output.appendChild(span);
    container_1.appendChild(output);
    var n1 = void 0;
    var n2 = void 0;
    var oprator = void 0;
    container_1.onclick = function (event) {
        if (event.target instanceof HTMLButtonElement) {
            var button = event.target;
            var text = button.textContent;
            if ('0123456789'.indexOf(text) >= 0) {
                console.log("数字");
            }
            else if ('+-*/'.indexOf(text) >= 0) {
                console.log("操作符");
            }
            else {
                console.log("不知道");
            }
        }
    };
    var keys = [['clear', '/'], ['7', '8', '9', '*'], ['4', '5', '6', '-'], ['1', '2', '3', '+'], ['0', '.', '=']];
    keys.forEach(function (item, index) {
        var div = document.createElement('div');
        div.classList.add('row');
        item.forEach(function (text) {
            createButton(text, div, "button text-" + text);
        });
        container_1.appendChild(div);
    });
}
